<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>测试buffer</title>
    <script src="../zujian/han/han.js"></script>
</head>
<body>
<script type="text/javascript">
    //buffer是nodejs的东西不是js的
    const buf = Buffer.from('runoob', 'ascii');

    // 输出 72756e6f6f62
    hwrite(buf.toString('hex'));

    // 输出 cnVub29i
    hwrite(buf.toString('base64'));
</script>
</body>
</html>